<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title></title>
    <link rel="stylesheet" href="__STATIC__/css/mui.min.css"/>
    <link rel="stylesheet" href="__STATIC__/css/common.css">
    <link rel="stylesheet" href="__STATIC__/css/module.css"/>
    <script src="__STATIC__/js/jquery.min.js"></script>
    <script src="__STATIC__/js/mui.min.js"></script>
</head>

<body>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-arrowleft mui-pull-left"></a>
    <h1 class="mui-title">昵称</h1>
    <button class="mui-btn mui-btn-link mui-link-green mui-pull-right" onclick="sub();">保存</button>
</header>
<div class="mui-content">
    <div class="change-nickname">
        <input type="text" placeholder="请输入昵称" value="{$nicheng}" id="ni">
        <p>4-20个字符，可由中英文、数字、“_”、“-”组成</p>
    </div>
</div>
</body>
<script type="text/javascript">
function sub(){
	var name = $("#ni").val();
	if (name=='') {alert("请填写昵称");return false;}
	url = "{:url('index/User/nicheng')}";
            $.post(url, {name:name}, function (data) {
            	if (data==1) {
            		alert("修改成功");
            		location.href="{:url('index/User/xinxi')}";
            	}
            })
}
</script>
</html>